from accounts.serializers import UserSeri
from common.serializers import ExcludeableSeri
from wx.models import WXUser
from wx.wxcommon.serializers import WechatUserInfoSeri


class WXUserSeri(WechatUserInfoSeri):
    user = UserSeri(required=False)

    def create(self, validated_data):
        u = WXUser.objects.create(**validated_data)
        u.save()
        return u

    class Meta:
        model = WXUser
        fields = '__all__'
